package com.xmut.mall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xmut.mall.order.searchparam.ManagerOrderSearchParam;
import com.xmut.mall.order.searchparam.OrderSearchParams;
import com.xmut.mall.order.entity.OrderEntity;
import com.xmut.mall.order.searchparam.SellerOrderSearchParam;
import com.xmut.mall.order.to.OrderDeliveryDto;
import com.xmut.mall.order.to.UpdateOrderConsigneeDto;
import com.xmut.mall.order.utils.RespBean;
import com.xmut.mall.order.vo.PageVO;

import java.util.Map;

public interface OrderService extends IService<OrderEntity> {

    /**
     * 保存订单
     * @param entity
     * @return
     */
    RespBean createOrder(OrderEntity entity);

    /**
     * 订单因为超时为支付而取消
     * @param param
     */
    void cancelOrderReasonTimeout(Map<String, Object> param);

    /**
     * 收到MQ消息之后创建订单和订单项
     * @param param
     */
    void MQCreateOrder(Map<String, Object> param);

    /**
     * 获取用户中心中的订单分页数据
     *
     * @param vo
     * @param params
     * @return
     */
    RespBean getBuyerOrderByPage(PageVO vo, OrderSearchParams params);

    /**
     * 获取订单详情
     * @return
     */
    RespBean getOrderDetail(Map<String, Object> params);

    /**
     * 获取卖家端的订单分页数据
     *
     * @param vo
     * @param param
     * @return
     */
    RespBean getSellerOrderByPage(PageVO vo, SellerOrderSearchParam param);

    /**
     * 获取商城官方平台的订单分页数据
     * @param vo
     * @param param
     * @return
     */
    RespBean getManagerOrderByPage(PageVO vo, ManagerOrderSearchParam param);

    /**
     * 修改订单价格
     * @param params
     * @return
     */
    RespBean updateOrderPrice(Map<String, Object> params);

    /**
     * 修改订单收货地址
     * @param dto
     * @return
     */
    RespBean updateOrderConsignee(UpdateOrderConsigneeDto dto);

    /**
     * 订单发货
     * @param dto
     * @return
     */
    RespBean orderDelivery(OrderDeliveryDto dto);

    /**
     * 获取物流信息
     * @param sn
     * @return
     */
    RespBean getTraces(String sn);

    /**
     * 官方管理平台取消订单
     * @param params
     * @return
     */
    RespBean ManagerCancelOrder(Map<String, Object> params);

    /**
     * 用户取消订单
     * @param params
     * @return
     */
    RespBean userCancelOrder(Map<String, Object> params);

    /**
     * 用户确认收货
     * @param params
     * @return
     */
    RespBean userReceiveOrder(Map<String, Object> params);
}

